package cn.edu.java.io.reader;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;

public class InputStreamReaderDemo {
    public static void main(String[] args) {
        try (Reader reader = new InputStreamReader(new FileInputStream("input/名单.txt"), "UTF-8")) {

            // 读取字符流
            int data;
            while ((data = reader.read()) != -1) {
                char character = (char) data;
                System.out.print(character);
            }

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

